package com.example.oj_springboot.api;

import com.example.oj_springboot.api.config.exception.CodeNullException;
import com.example.oj_springboot.model.Problem;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;

@RequestMapping("/problem")
public interface ProblemRest {

    @RequestMapping(value = "/getOne",method = RequestMethod.GET)
    Problem getProblem(String id) throws Exception;

    @RequestMapping(value = "/getAll",method = RequestMethod.GET)
    List<Problem> getProblems();

    @RequestMapping(value = "/add",method = RequestMethod.POST)
    void addProblem(Problem problem) throws CodeNullException;

    @RequestMapping(value = "/delete",method = RequestMethod.DELETE)
    void delete(String id) throws Exception;
}